package com.spms.controller;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.spms.entity.Admin;
import com.spms.entity.Student;
import com.spms.entity.Teacher;
import com.spms.service.Impl.AdminServiceImpl;

@RestController
@ResponseBody
public class AdminController {	
	@Autowired
	private AdminServiceImpl adminservice;
	
	@RequestMapping("/admin/DeleteStudent")
	public int  DeleteStudent(int s_id){
		return adminservice.DeleteStudent(s_id);
	}
	
	
	@RequestMapping("/admin/DeleteTeacher")
	public int  DeleteTearcher(int t_id) {
		return adminservice.DeleteTeacher(t_id);
	}
	
	@RequestMapping("/admin/queryAllStudent")
	public List<Student> queryAllStudent() {
		return adminservice.queryAllStudent();
	}
	
	@RequestMapping("/admin/queryAllTeacher")
	public List<Teacher> queryAllTeacher() {
		return adminservice.queryAllTeacher();
	}
	
	@RequestMapping("/admin/register")
	public int adminRegister(Admin admin)
	{
		return adminservice.adminRegister(admin);
	}
	
	@RequestMapping("/admin/login")
	public Admin adminLogin(String user_name, String user_password)
	{
		return adminservice.adminLogin(user_name,user_password);
	}
	
}